package com.flyqiu.form.model.entity;


import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.flyqiu.common.mybaits.plus.type.MyBaitsFastJson2ObjectHandler;
import com.flyqiu.form.model.enums.FlyQiuFormDeploymentStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName(value = "fly_qiu_table_config", autoResultMap = true)
public class FlyQiuTableConfig {
    @TableId(type = IdType.ASSIGN_UUID)
    @Schema(title = "主键")
    private String id;
    @Schema(title = "名称")
    private String formName;
    @Schema(title = "父级id")
    private String parentId;
    @Schema(title = "数据源key")
    private String dataSourceKey;
    @Schema(title = "表单组别")
    private String formCategory;
    @Schema(title = "表单编码")
    private String formCode;
    @Schema(title = "表名称")
    private String tableName;
    @Schema(title = "表单版本号")
    private Long tableVersion;
    @Schema(title = "上一个版本")
    private Long tablePreVersion;

    @Schema(title = "表配置")
    @TableField(typeHandler = MyBaitsFastJson2ObjectHandler.class)
    private JSONObject formOption;
    /**
     * 发布状态
     * {@link FlyQiuFormDeploymentStatus}
     */
    @Schema(title = "发布状态", description = "0:待发布 100:已发布")
    private Integer deploymentStatus;
    @Schema(title = "数据删除模式", description = "0 物理删除 1逻辑删除")
    private Integer dataDelMode;
    @Schema(title = "数据删除标记", description = "数据删除标记 1")
    private Integer dataDelFlag;
    @Schema(title = "数据未删除标记", description = "数据未删除标记 0 ")
    private Integer dataNotDelFlag;
    @Schema(title = "存储器类型")
    private String dataStorageType;
    @Schema(title = "扩展属性")
    @TableField(typeHandler = MyBaitsFastJson2ObjectHandler.class)
    private JSONObject props;
    @Schema(title = "扩展参数")
    private String params;
    @Schema(title = "扩展参数1")
    private String params1;
    @Schema(title = "扩展参数2")
    private String params2;
    @Schema(title = "扩展参数3")
    private String params3;
    @Schema(title = "扩展参数4")
    private String params4;

    @Schema(title = "创建时间")
    private LocalDateTime createTime;
    @Schema(title = "修改时间")
    private LocalDateTime updateTime;
    @Schema(title = "创建人")
    private String createBy;
    @Schema(title = "修改人")
    private String updateBy;

    @Schema(title = "租户id")
    private String tenantId;
    /**
     * 是否删除
     */
    @TableLogic
    @Schema(title = "逻辑删除标记")
    private Integer deleteFlag;

}
